<?php 
$v_af_id = $_REQUEST['hdn_af_id'];
$_MODAL_DIALOG_MODE = 1;
// Kiem tra xem nguoi dang nhap hien thoi co quyen thuc hien chuc nang nay hay khong
$function_code = _CONST_ONEGATE_AF_UPDATE;   //Update
if(!_check_permission_on_function($_SESSION['staff_id'], $_ISA_APP_CODE, $function_code)){?>
	<script>
		alert("<? echo _CONST_FUNCTION_PERMISSION_ERROR; ?>");
		if (_MODAL_DIALOG_MODE==1){
			window.location = "<? echo $v_url; ?>";
		}else{
			window.history.back();
		}	
	</script><?
	exit;
}
$v_af_concern_id_list = $_REQUEST['hdn_af_concern_id_list'];
if(_is_sqlserver()){
	$sql = "Exec ONEGATE_AfConcernAdd ";
	$sql = $sql.$v_af_id;
	$sql = $sql . ",'" . $v_af_concern_id_list. "'";
	$result = mssql_query($sql,$conn);
	$rs = @mssql_fetch_array($result);
	$v_error = _replace_bad_char(trim($rs['RET_ERROR']));
}sleep(0);
if (!is_null($v_error) && $v_error<>""){?>
	<script>
		alert("<?php echo $v_error; ?>");
		if (_MODAL_DIALOG_MODE==1){
			window.location = "<?php echo $v_goto_url; ?>";
		}else{
			window.history.back();
		}	
	</script><?php
	exit;
}
?>
<form action="index.php" method="post" name="f_back">
	<input type="hidden" name="fuseaction" value="DISPLAY_ALL_AF_CONCERN">
	<input type="hidden" name="hdn_af_id" value="<?php echo $v_af_id;?>"><?
	if ($v_allow_editing_in_modal_dialog==1){?>
		<input name="allow_editing_in_modal_dialog" type="hidden" value="1"><?
	}
	//echo $_MODAL_DIALOG_MODE;
	if ($_MODAL_DIALOG_MODE==1){?>
		<input name="modal_dialog_mode" type="hidden" value="<? echo $_MODAL_DIALOG_MODE;?>"><?
	}?>	
</form>
<Script language="javascript">
	goto_after_update_data(0, "DISPLAY_ALL_AF_FOR_ADDING","");
</Script>